// 快捷键：rcc，快速生成jsx组件模板代码
// 导入react
import React from 'react';
// 导入该组件的scss样式文件
import './Search.scss';
import logo from '../../components/Home/imgs/logo.png'

// 使用ES6中的类
class Search extends React.Component {
    // props,父子间进行传值
    constructor(props) {
        super(props);
        this.state = {
            logo: logo,
            searchKey: ""
        }
    }
    redirectPage() {
        this.props.history.push('/search')
    }
    render() {
        return (
            <div className='Input'>
                <div>
                    <img src={this.state.logo} alt="" />
                    <p>足不出户&nbsp;&nbsp;享受全球奢品</p>
                </div>
                <input className='iconfont' placeholder='&#xe651;请输入关键字' onFocus={() => {
                    this.redirectPage()
                }}
                    type="text"></input>
                <span><p className='iconfont'>&#xec2e;</p><p>客服</p></span>
            </div>
        );
    }
}

export default Search;